home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #49 (Oct 89) / After Dark Source / GraphicsModuleTypes.p < prev   
Text File  |  1989-07-21  |  3KB  |  87 lines

  1. { Types for After Dark graphics module. }
  2. { For more information, consult the programmer's section of the manual. }
  3. { ©1989 Berkeley Systems, Inc. }
  4.  
  5. unit GraphicsModuleTypes;
  6.  
  7. interface
  8.  
  9.  
  10.     const
  11.  
  12. { These messages are passed to main() by After Dark. }
  13. { Initialize:        Call DoInitialize().}
  14. { Close:            Call DoClose().}
  15. { Blank:            Call DoBlank().}
  16. { DrawFrame:        Call DoDrawFrame().}
  17. { ButtonMessage:    Call DoSetup().}
  18.  
  19.         Initialize = 0;
  20.         Close = 1;
  21.         Blank = 2;
  22.         DrawFrame = 3;
  23.         ButtonMessage = 8;
  24.  
  25. { Return Values }
  26. { These two values can be returned by DoInitialize(), DoClose(), }
  27. { Call DoBlank(), and DoDrawFrame(). }
  28.  
  29. { RestartMe:        Tells After Dark to send an "Initialize" message to main(). }
  30. { ImDone:            Tells After Dark not to call your function main() and to handle drawing. }
  31.  
  32.         RestartMe = 1;
  33.         ImDone = 2;
  34.  
  35. { This value can be returned by DoSetup(). }
  36. { RefreshResources:        Tells After Dark to redisplay all controls with the values in the}
  37. { graphic module's resource fork. }
  38.  
  39.         RefreshResources = 3;
  40.  
  41. { Data structures for After Dark graphics modules. }
  42.  
  43.     type
  44.         {Description of each monitor on system.}
  45.         MonitorData = packed record
  46.                 bounds: Rect;            { Bounding rectangle in global coords. }
  47.                 synchFlag: Boolean;     { Flag set by monitor VBL task. }
  48.                 curDepth: Byte;        { Current pixel depth of monitor. }
  49.             end;
  50.  
  51.         {List Record.}
  52.         MonitorsInfo = record
  53.                 monitorCount: integer;    { Number of monitors in use. }
  54.                 monitorList: array[0..0] of MonitorData;    { List of monitors. }
  55.             end;
  56.         MonitorsInfoPtr = ^MonitorsInfo;
  57.  
  58.         {Copy of Quickdraw globals.}
  59.         QDGlobals = record
  60.                 qdThePort: GrafPtr;    { Pointer to current grafPort. }
  61.                 qdWhite: Pattern;    { All-white pattern. }
  62.                 qdBlack: Pattern;    { All-black pattern. }
  63.                 qdGray: Pattern;    { 50% gray pattern. }
  64.                 qdLtGray: Pattern;    { 25% gray pattern. }
  65.                 qdDkGray: Pattern;    { 75% gray pattern. }
  66.                 qdArrow: Cursor;    { Standard arrow cursor. }
  67.                 qdScreenBits: BitMap;    { The entire screen. }
  68.                 qdRandSeed: longint;    { Where Random sequence begins. }
  69.             end;
  70.         QDGlobalsPtr = ^QDGlobals;
  71.  
  72.         {Param Block passed each time to the graphics module.}
  73.         GMParamBlock = record
  74.                 controlValues: array[0..3] of integer;    { The values of the user set controls. }
  75.                 monitors: MonitorsInfoPtr;    { Info about connected monitors. }
  76.                 colorQDAvail: Boolean;        { Whether the Mac has Color QuickDraw. }
  77.                 colorQDConfig: integer;        { Configuration info about the Mac. }
  78.                 qdGlobalsCopy: QDGlobalsPtr;{ A copy of the QuickDraw Globals. }
  79.                 brightness: integer;        { Sets the brightness to this level. }
  80.                 demoRect: Rect;                { The Control Panel rectangle. }
  81.                 errorMessage: StringPtr;    { string to be displayed if error encountered. }
  82.             end;
  83.         GMParamBlockPtr = ^GMParamBlock;
  84.  
  85. implementation
  86.  
  87. end.